home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group93c.txt
/
000002_icon-group-sender _Wed Jun 30 16:12:52 1993.msg
< prev
next >
Wrap
Internet Message Format
|
1994-02-02
|
1KB
Received: from owl.CS.Arizona.EDU by cheltenham.CS.Arizona.EDU; Wed, 30 Jun 1993 18:02:39 MST
Received: by owl.cs.arizona.edu; Wed, 30 Jun 1993 18:02:38 MST
Date: Wed, 30 Jun 1993 16:12:52 MST
From: "Clint Jeffery" <cjeffery>
Message-Id: <199306302312.AA27120@chuckwalla.cs.arizona.edu>
To: Paul_Abrahams@MTS.cc.Wayne.edu
Cc: icon-group@cs.arizona.edu
In-Reply-To: Paul_Abrahams@MTS.cc.Wayne.edu's message of Wed, 30 Jun 93 16:35:14 EDT <692691@MTS.cc.Wayne.edu>
Subject: Re: Tables versus lists
Status: R
Errors-To: icon-group-errors@cs.arizona.edu
Paul Abrahams writes, regarding:
push(array, element)
versus
array[integer(*array+1)] := element
My question is: how do the efficiencies of these constructs compare?
Why not run timings and tell us? Detailed knowledge of the implementation
helps make guesses, but in Icon the measured results often bely intuition.
Regarding the implementation, the "linked list" that is traversed for each
list index operation is typically only of length log(*L) and performs very
well. But the implementation of tables in Icon is awfully clever (thanks
to Bill Griswold and Gregg Townsend). My intuition is that the cost of the
integer(*array+1) expression is what turns the tables. By the way, do you
really need that function call to integer() there?
Clint Jeffery